package com.stylefeng.guns.modular.system.warpper;

import java.text.DecimalFormat;
import java.util.Date;
import java.util.Map;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.util.DateUtil;

public class HsgtStatsWarpper extends BaseControllerWarpper{

	public HsgtStatsWarpper(Object list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
    	DecimalFormat df = new DecimalFormat("0.00");
		Date date = ((Date)map.get("gDetailDate"));
		
		map.put("gDetailDate", DateUtil.format(date, "yyyy-MM-dd"));
		double gDrzjlr = ((Double)map.get("gDrzjlr")) / 100;
		map.put("gDrzjlr", (gDrzjlr >0 ? "<font color='red'><b>"+df.format(gDrzjlr)+"</b></font>" : "<font color='green'><b>"+df.format(gDrzjlr)+"</b></font>"));
		
		double gDaye = ((Double)map.get("gDaye")) / 100;
		map.put("gDaye", (gDaye >0 ? "<font color='red'><b>"+df.format(gDaye)+"</b></font>" : "<font color='green'><b>"+df.format(gDaye)+"</b></font>"));
		
		double gSlzjlr = ((Double)map.get("gSlzjlr")) / 100;
		map.put("gSlzjlr", (gSlzjlr >0 ? "<font color='red'><b>"+df.format(gSlzjlr)+"</b></font>" : "<font color='green'><b>"+df.format(gSlzjlr)+"</b></font>"));
		
		double gDrcjjme = ((Double)map.get("gDrcjjme")) / 100;
		map.put("gDrcjjme", (gDrcjjme >0 ? "<font color='red'><b>"+df.format(gDrcjjme)+"</b></font>" : "<font color='green'><b>"+df.format(gDrcjjme)+"</b></font>"));
		
    }
}
